<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // var sum = 0;
        // var average = 0;
        // for (var i = 1; i <= 100; i++){
        //     sum = sum +i;
        // }
        // average = sum/100;
        // console.log(average);
        // 2.1~100之间的奇数和偶数
        var ma = 0;
        var yun = 0;
        for (var i = 1; i <= 100; i++){
            if (i % 2 == 0){
                ma = ma + i;
            } else {
                yun = yun + i;
            }
            

        }
        console.log('1~100之间的偶数和是：' + ma);
            console.log('1~100之间的奇数和是：' + yun);
        // 3.被3整除的和
        var dong = 0;
        for (var i = 1; i <= 100; i++){
            if (i % 3 ==0){
                dong = dong + i;
            }
        }
        console.log(dong);

    </script>
</head>
<body>
    
</body>
</html>